/**
 * @file app\tasks\mobus\devices\_restore_factory.c
 *
 * Copyright (C) 2023
 *
 * _restore_factory.c is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author HinsShum hinsshum@qq.com
 *
 * @encoding utf-8
 */

/*---------- includes ----------*/
/*---------- macro ----------*/
/*---------- type define ----------*/
/*---------- variable prototype ----------*/
/*---------- function prototype ----------*/
/*---------- variable ----------*/
/*---------- function ----------*/
static void _restore_factory(mobus_device_t self, uint8_t sync) {
  //    struct dp_storage dp_storage = {
  //        .type = DP_STORAGE_TYPE_RESTORE,
  //        .param.restore.bits = DP_STORAGE_RESTORE_BIT_MOBUS_DEVICE |
  //                DP_STORAGE_RESTORE_BIT_MOBUS_GROUPS,
  //    };
  //    struct dp_morf dp_morf = {
  //        .type = DP_MORF_TYPE_CHANNEL_CONF,
  //        .param.conf.type = DP_MORF_CHANNEL_CONF_DEL,
  //        .param.conf.device_type = MOBUS_DEVICE_TYPE_UNKNOWN,
  //    };

  //    protocol_mobus_ack(self->native_address, sync, MOBUS_ACK_OK);
  //    /* clear channels */
  //    for(uint8_t i = 0; i < self->channel_nums; ++i) {
  //        if(self->channels[i].device_type != MOBUS_DEVICE_TYPE_UNKNOWN) {
  //            dp_morf.param.conf.sub_channel = i;
  //            self->act->ops.notify(self->act, "morf", &dp_morf,
  //            sizeof(dp_morf));
  //        }
  //    }
  //    /* restore */
  //    self->act->ops.notify(self->act, "storage", &dp_storage,
  //    sizeof(dp_storage)); self->init(self, self->mobus, self->act);
  //    self->req_access_to_mobus_network(self);
}
